/*
   Copyright 2009 Bloo. All Rights Reserved.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/
package org.youtensils.client.plugin.applet;

/**
 * An interface defining download event handlers.
 * @author Bobby Soares
 */
public interface DownloadListener {
	/**
	 * Signals the start of a download.
	 * @param itemId the id of the downloading item
	 */
	public void onDownloadStart(String itemId);
	/**
	 * Signals the completion of a download.
	 * @param itemId the id of the downloading item
	 */
	public void onDownloadComplete(String itemId);
	/**
	 * Signals the cancellation of a download.
	 * @param itemId the id of the downloading item
	 */
	public void onDownloadCancel(String itemId);
	/**
	 * Signals that a download error has occurred.
	 * @param itemId the id of the downloading item
	 * @param error
	 */
	public void onDownloadError(String itemId, String error);
	/**
	 * Signals that download progress has changed.
	 * @param itemId the id of the downloading item
	 * @param totalSteps the total number of steps required to successful download completion
	 * @param currentStep the current step
	 * @param totalBytes the total byte size of the item being downloaded
	 * @param loadedBytes the amount of bytes that have loaded for the item being downloaded
	 * @param label a label describing the current step
	 */
	public void onDownloadProgress(String itemId, int totalSteps, int currentStep, int totalBytes, int loadedBytes, String label);
}
